< previous page page_44 next page >

Page 44
8694cbadb9b1ef7075903f6f95fc1db2.gif
57:  change progressbar value to indicate the status of
58:  the copy function
59:         prgStatus.Value = intLoopCtr
60:
61:  the DoEvents command allows Windows to update
62:  the controls on the form
63:         DoEvents
64:     Next intLoopCtr
65:
66:  After the copy is complete close both files
67:     Close #1    Close file.
68:     Close #2    Close file.
69:
70:  Stop the animation and make all related controls
71:  invisible
72:     anmShowAction.Stop
73:     anmShowAction.Visible = False
74:     prgStatus.Visible = False
75:     lblDisplay.Visible = False
76:
77:  Inform the user that the function is complete
78:     MsgBox Copy function complete, vbInformation
79: End Sub

Before executing this application, you must change the source file string to a file that exists on your computer, and change the destination file string to a valid path and filename. Also, double-check the path of the .AVI file, in case you didn't use the default directory paths when you installed Visual Basic.
Execute the application and click the File Copy command button; what you should see should closely resemble the Windows 95 File Copy dialog box. This is only one example of what you can do when combining different controls. The only limitation you'll have is your own imagination when thinking of new combinations of controls. Of course, some combinations already exist in Visual Basic, and it's silly to reinvent the wheel. Day 2's lesson, however, will enhance this example with the Common Dialog control.
Summary
Today's lesson covered several different topics that are important to you as a Visual Basic programmer. The first is the need to properly plan out what your application will be, as well as the design of the application. This way, you can create an application that will look and perform well. It also discussed the importance of proper programming

 
< previous page page_44 next page >

If you like this book, buy it!